package com.lijian.user.controller;

import com.lijian.common.domain.R;
import com.lijian.user.domain.dto.LoginFormDTO;
import com.lijian.user.domain.vo.UserLoginVO;
import com.lijian.user.openfeign.client.NoteClient;
import com.lijian.user.openfeign.dto.NoteDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LiJian
 * @date 2024-11-06
 */
@Api(tags = "文档控制器")
@RestController
@RequestMapping("/note")
@RequiredArgsConstructor
public class NoteController {
    private final NoteClient client;

    @ApiOperation("保存笔记接口")
    @PostMapping("add")
    public R<?> save(@ApiParam("笔记实体") @RequestBody @Validated NoteDto noteDto) {
        boolean flag = client.saveNote(noteDto);
        return R.ok(flag?"保存成功":"保存失败");
    }


}
